﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace Wilke.Interactive.Drone.PlayGround
{
    /// <summary>
    /// Interaction logic for StatusButton.xaml
    /// </summary>
    public partial class StatusButton : UserControl
    {
        public StatusButton()
        {
            InitializeComponent();
        }

        public Storyboard Blink { get { return this.Resources["ColorBlink"] as Storyboard; } }

        private Brush innerButtonColor;
        public Brush InnerButtonColor 
        {
            get { return innerButtonColor; }
            set 
            { 
                innerButtonColor = value;
                ellipse.Fill = value;
            } 
        }

        private bool blinking;
        public bool IsBlinking
        {
            get
            {
                return blinking;
            }
            set
            {
                if (value)
                {
                    this.Blink.Begin();
                }
                else
                {
                    this.Blink.Stop();
                }

                this.blinking = value;
            }
        } 

    }
}
